<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div id="app"><counter></counter></div>
    <div id="app2"><counter></counter></div>
    <script src="https://unpkg.com/vue@2.6.14/dist/vue.js"></script>
    <script>
      var vm = new Vue({
        el: "#app",
        data: { msg: "hello" },
        components: {
          counter: {
            data: () => ({ count: 0 }),
            methods: {
              increase() {
                this.count++;
              },
            },
            template: `<button @click="increase">{{count}}<child-counter></child-counter></button>`,
            components:{
                ['child-counter']:{
                    template: `<span>child-counter</span>`,
                }
            }
          },
        },
      });
      var vm2 = new Vue({
        el: "#app2",
        data: { msg: "hello" }
      });
    </script>
  </body>
</html>
